<template>
	<view>
		<navigator :url="url" class="banner-item" v-if="tp==1">
			<uni-icons :type="type" size="30" :color="color"></uni-icons>
			<view class="titles">
				{{title}}
			</view>
		</navigator>
		<navigator :url="url" class="banner-item" open-type="switchTab" v-if="tp==2">
			<uni-icons :type="type" size="30" :color="color"></uni-icons>
			<view class="titles">
				{{title}}
			</view>
		</navigator>
	</view>
</template>

<script>
	export default {
		name:"BannerItem",
		// props:['type','title','url'],
		props:{
			'tp':{
				type:Number,
				default:1
			},
			'color':{
				type:String,
				default:''
			},
			'type':{
				type:String,
				default:''
			},
			'title':{
				type:String,
				default:''
			},
			'url':{
				type:String,
				default:''
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			goTab(){
				console.log('jjhh')
				uni.switchTab({
					url:'/pages/preOrder/preOrder'
				})
			}
		}
	}
</script>

<style lang="scss">
.banner-item{
	text-align: center;
	.titles{
		padding-top: 8rpx;
	}
}
</style>